/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.basicdata.basictree.service;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.basicdata.basictree.entity.PartDevice;
import com.jeeplus.modules.basicdata.basictree.mapper.PartDeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional(readOnly = true)
public class PartDeviceService extends CrudService<PartDeviceMapper, PartDevice> {

	@Autowired
	private PartDeviceMapper partDeviceMapper;

	public PartDevice get(String deviceId) {
		return super.get(deviceId);
	}
	
	public List<PartDevice> findList(PartDevice partDevice) {
		return super.findList(partDevice);
	}
	
	public Page<PartDevice> findPage(Page<PartDevice> page, PartDevice partDevice) {
		return super.findPage(page, partDevice);
	}
	
	@Transactional(readOnly = false)
	public void save(PartDevice partDevice) {
		super.save(partDevice);
	}
	
	@Transactional(readOnly = false)
	public void delete(PartDevice partDevice) {
		super.delete(partDevice);
	}

	public List<PartDevice> getChildern(PartDevice partDevice) {
		return mapper.getChildren(partDevice);
	}

	public PartDevice getByFileCode(String fileCode) {
		return mapper.getByFileCode(fileCode);
	}
	
}